﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace FHJFPro.AppSettings
{
    public class AppSetting
    {
        /// <summary>
        /// 配置文件的根节点
        /// </summary>
        private static readonly IConfigurationRoot _config;


        static AppSetting()
        {
            // 加载appsettings.json，并构建IConfigurationRoot
            var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json", true, true);
            _config = builder.Build();
        }
       
        /// <summary>
        /// 数据库连接字符串
        /// </summary>
        public static string ConnectionStrings => _config["ConnectionStrings:Default"];

        /// <summary>
        /// hangfire验证账号
        /// </summary>
        public static class Hangfire
        {
            public static string Login => _config["Hangfire:Login"];

            public static string Password => _config["Hangfire:Password"];
        }
    }
}
